//
//  ViewController.m
//  countDownTimer
//
//  Created by fanxiao on 16/3/4.
//  Copyright © 2016年 尚宇电子. All rights reserved.
//

#import "ViewController.h"
#import "CountdownModule.h"

@interface ViewController ()
@property (nonatomic, strong) CountdownModule *model;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    CountdownModule *model = [[CountdownModule alloc]initWithFrame:CGRectMake(50, 100, 300, 50)];
    model.count = 20;
    [self.view addSubview:model];
    self.model = model;
    
    UIButton *resetButton = [[UIButton alloc]initWithFrame:CGRectMake(50,200, 50, 50)];
    [resetButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [resetButton setTitle:@"复位" forState:UIControlStateNormal];
    [resetButton addTarget:self action:@selector(resetCountdown) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:resetButton];
    
}

-(void)resetCountdown
{
    [self.model resetCountDownModuleWithCount:93884];
}

@end
